<%@ page contentType="text/html;charset=UTF-8" import=" com.thinkgem.jeesite.modules.hydms.healthcheck.entity.DmsHealthCheck"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>卫生检查管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认要导出卫生信息数据吗？","系统提示",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/healthcheck/dmsHealthCheck/export");
						$("#searchForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','60px');
			});
			$("#btnImport").click(function(){
				$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true}, 
					bottomText:"导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"});
			});
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
	<link type="text/css" rel="stylesheet" href="${ctxStatic}/css/dmsHealthCheckForm.css" />
	<script type="text/javascript" src="${ctxStatic}/layer/layer.js"></script>
</head>
<body>
 	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/healthcheck/dmsHealthCheck/">卫生检查列表</a></li>
		<%-- <shiro:hasPermission name="healthcheck:dmsHealthCheck:edit"><li><a href="${ctx}/healthcheck/dmsHealthCheck/form">卫生检查添加</a></li></shiro:hasPermission> --%>
	</ul> 
	
	 <div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/healthcheck/dmsHealthCheck/import" method="post" enctype="multipart/form-data"
			class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入，请稍等...');"><br/>
			<input id="uploadFile" name="file" type="file" style="width:350px"/><br/><br/>　　
			<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "/>
			<a href="${ctx}/healthcheck/dmsHealthCheck/template">下载模板</a>
		</form>
	</div>
	
	<form:form id="searchForm" modelAttribute="dmsHealthCheck" action="${ctx}/healthcheck/dmsHealthCheck/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>检查日期：</label>
				<input name="checkDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate w"
					value="<fmt:formatDate value="${dmsHealthCheck.checkDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li>
			<li><label>宿舍号：</label>
				<form:input path="dormitoryNumber" htmlEscape="false" maxlength="20" class="input-medium w" />
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="btns">
			<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>
			<input id="btnImport" class="btn btn-primary" type="button" value="导入"/>
			</li>
			<li class="btns"><a href="${ctx}/healthcheck/dmsHealthCheck/form"><input id="btnSubmit" class="btn btn-primary" type="button" value="添加检查结果"/></a></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>检查日期</th>
				<th>宿舍号</th>
				<th>地面</th>
				<th>墙面</th>
				<th>阳台</th>
				<th>其它</th>
				<th>检查结果</th>
				<th>备注</th>
				<shiro:hasPermission name="healthcheck:dmsHealthCheck:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="dmsHealthCheck">
			<tr>
				<td><%-- <a href="${ctx}/healthcheck/dmsHealthCheck/form?id=${dmsHealthCheck.id}"> --%>
					<fmt:formatDate value="${dmsHealthCheck.checkDate}" pattern="yyyy-MM-dd"/>
				<!-- </a> --></td>
				<td>
					${dmsHealthCheck.dormitoryNumber}
				</td>
				<td>
					${dmsHealthCheck.ground}
				</td>
				<td>
					${dmsHealthCheck.metop}
				</td>
				<td>
					${dmsHealthCheck.balcony}
				</td>
				<td>
					${dmsHealthCheck.others}
				</td>			
				<td>
					${dmsHealthCheck.checkResult}
				</td>
				<td>
					${dmsHealthCheck.remarks}
				</td>
				<shiro:hasPermission name="healthcheck:dmsHealthCheck:edit"><td>
    				<%-- <a href="${ctx}/healthcheck/dmsHealthCheck/form?id=${dmsHealthCheck.id}">修改</a> --%>
					<a href="${ctx}/healthcheck/dmsHealthCheck/delete?id=${dmsHealthCheck.id}" onclick="return confirmx('确认要删除该卫生检查吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>